' BASIC Anywhere Machine program by Charlie Veniot
' Trigonometric functions by Hamid Naderi Yeganeh for "Magpie" at https://www.huffpost.com/entry/mathematical-birds_b_8876904
dim k, a, b, r as double
pi = 3.1415929
screen _newimage(5000, 4000, 21)
k1 = -10000
k2 = 10000
couleur = &hff0000
s = 1
for r = 16 to 20 step 1
gosub a_run
sleep 0.0125
next r
end
a_run:
for k = k1 to k2 step s
a = int( ( (11*k/100000)+(cos(41*pi*k/10000))^6*sin((k/10000)^7*(pi/2)) )*1000 )
b = int( ( (-1)*(cos(41*pi*k/10000))^6*cos((k/10000)^7*(pi/2))*(1+(5/2)*(cos(3*pi*k/100000)*cos(9*pi*k/100000))^8)+(1/2)*(cos(pi*k/40000)*cos(3*pi*k/40000)*cos(3*pi*k/20000))^10 )*1000)
circle (2500-a,750-b), r, couleur
next k
return